package com.pi.uc.model.user;

import com.alibaba.fastjson.JSON;
import com.pi.uc.service.validate.group.UserAdd;
import com.pi.uc.service.validate.group.UserUpdateWithExt;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.NotNull;

public class UserRegisterPostForm {
    @NotNull(message = "UC_USER.USER_ID_EMPTY")
    long loginUserId;
    @NotNull(message = "UC_USER.SEX_IS_EMPTY")
    private Integer sex;  //性别 1. 男性 2.女性
    @NotBlank(message = "UC_USER.MOBILE_IS_EMPTY", groups = {UserAdd.class, UserUpdateWithExt.class})
    @Length(min = 11, max = 11, message = "UC_USER.MOBILE_LENGTH_ERROR")
    private String mobile;  //手机号
    @NotNull(message = "UC_USER.AGE_IS_EMPTY")
    private Integer age;  //年龄
    @NotBlank(message = "UC_USER.NAME_IS_EMPTY", groups = {UserAdd.class, UserUpdateWithExt.class})
    @Length(max = 20, message = "UC_USER.NAME_LENGTH_ERROR", groups = UserAdd.class)
    private String name; //姓名
    @NotBlank(message = "UC_USER.EDU_IS_EMPTY", groups = UserAdd.class)
    @Length(max = 10, message = "UC_USER.EDU_LENGTH_ERROR", groups = UserAdd.class)
    private String education;  //教育程度
    private String nickName;
    private String avatar;
    @NotNull(message = "CONFIG_PARTNER.SOURCE_ID_EMPTY")
    private Long sourceId;

    public long getLoginUserId() {
        return loginUserId;
    }

    public void setLoginUserId(long loginUserId) {
        this.loginUserId = loginUserId;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getEducation() {
        return education;
    }

    public void setEducation(String education) {
        this.education = education;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public Long getSourceId() {
        return sourceId;
    }

    public void setSourceId(Long sourceId) {
        this.sourceId = sourceId;
    }

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
}
